package com.crazy.consumerservice.controller;

import com.crazy.consumerservice.feign.OcrClient;
import com.crazy.consumerservice.model.ImagePathRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api")
public class OcrController {

    @Autowired
    private OcrClient ocrClient;

    @PostMapping("/recognize")
    public String recognizeImage(@RequestParam String filePath) {
        ImagePathRequest request = new ImagePathRequest();
        request.setFilePath(filePath);
        return ocrClient.recognizeImage(request);
    }
}